<?php


abstract class BasePhpBbPost extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $post_id;


	
	protected $topic_id;


	
	protected $forum_id;


	
	protected $poster_id;


	
	protected $icon_id;


	
	protected $poster_ip;


	
	protected $post_time;


	
	protected $post_approved;


	
	protected $post_reported;


	
	protected $enable_bbcode;


	
	protected $enable_smilies;


	
	protected $enable_magic_url;


	
	protected $enable_sig;


	
	protected $post_username;


	
	protected $post_subject;


	
	protected $post_text;


	
	protected $post_checksum;


	
	protected $post_attachment;


	
	protected $bbcode_bitfield;


	
	protected $bbcode_uid;


	
	protected $post_postcount;


	
	protected $post_edit_time;


	
	protected $post_edit_reason;


	
	protected $post_edit_user;


	
	protected $post_edit_count;


	
	protected $post_edit_locked;


	
	protected $id;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getPostId()
	{

		return $this->post_id;
	}

	
	public function getTopicId()
	{

		return $this->topic_id;
	}

	
	public function getForumId()
	{

		return $this->forum_id;
	}

	
	public function getPosterId()
	{

		return $this->poster_id;
	}

	
	public function getIconId()
	{

		return $this->icon_id;
	}

	
	public function getPosterIp()
	{

		return $this->poster_ip;
	}

	
	public function getPostTime($format = 'Y-m-d H:i:s')
	{
		if ($this->post_time === null || $this->post_time === '')
        {
			return null;
		}elseif (!is_int($this->post_time))
        {
            $ts = strtotime($this->post_time);
			if( $ts === -1 || $ts === false )
            {
                throw new PropelException("Unable to parse value of [post_time] as date/time value: " . var_export($this->post_time, true));
			}
		} else
        {
			$ts = $this->post_time;
		}

		if ($format === null)
        {
			return $ts;
		} elseif (strpos($format, '%') !== false)
        {
			return strftime($format, $ts);
		} else
        {
			return date($format, $ts);
		}

		return $this->post_time;
	}

	
	public function getPostApproved()
	{

		return $this->post_approved;
	}

	
	public function getPostReported()
	{

		return $this->post_reported;
	}

	
	public function getEnableBbcode()
	{

		return $this->enable_bbcode;
	}

	
	public function getEnableSmilies()
	{

		return $this->enable_smilies;
	}

	
	public function getEnableMagicUrl()
	{

		return $this->enable_magic_url;
	}

	
	public function getEnableSig()
	{

		return $this->enable_sig;
	}

	
	public function getPostUsername()
	{

		return $this->post_username;
	}

	
	public function getPostSubject()
	{

		return $this->post_subject;
	}

	
	public function getPostText()
	{

		return $this->post_text;
	}

	
	public function getPostChecksum()
	{

		return $this->post_checksum;
	}

	
	public function getPostAttachment()
	{

		return $this->post_attachment;
	}

	
	public function getBbcodeBitfield()
	{

		return $this->bbcode_bitfield;
	}

	
	public function getBbcodeUid()
	{

		return $this->bbcode_uid;
	}

	
	public function getPostPostcount()
	{

		return $this->post_postcount;
	}

	
	public function getPostEditTime()
	{

		return $this->post_edit_time;
	}

	
	public function getPostEditReason()
	{

		return $this->post_edit_reason;
	}

	
	public function getPostEditUser()
	{

		return $this->post_edit_user;
	}

	
	public function getPostEditCount()
	{

		return $this->post_edit_count;
	}

	
	public function getPostEditLocked()
	{

		return $this->post_edit_locked;
	}

	
	public function getId()
	{

		return $this->id;
	}

	
	public function setPostId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_id !== $v) {
			$this->post_id = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_ID;
		}

	} 
	
	public function setTopicId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->topic_id !== $v) {
			$this->topic_id = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::TOPIC_ID;
		}

	} 
	
	public function setForumId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->forum_id !== $v) {
			$this->forum_id = $v;
			////$this->modifiedColumns[] = PhpBbPostPeer::FORUM_ID;
		}

	} 
	
	public function setPosterId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->poster_id !== $v) {
			$this->poster_id = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POSTER_ID;
		}

	} 
	
	public function setIconId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->icon_id !== $v) {
			$this->icon_id = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::ICON_ID;
		}

	} 
	
	public function setPosterIp($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->poster_ip !== $v) {
			$this->poster_ip = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POSTER_IP;
		}

	} 
	
	public function setPostTime($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_time !== $v) {
			$this->post_time = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_TIME;
		}

	} 
	
	public function setPostApproved($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_approved !== $v) {
			$this->post_approved = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_APPROVED;
		}

	} 
	
	public function setPostReported($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_reported !== $v) {
			$this->post_reported = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_REPORTED;
		}

	} 
	
	public function setEnableBbcode($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->enable_bbcode !== $v) {
			$this->enable_bbcode = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::ENABLE_BBCODE;
		}

	} 
	
	public function setEnableSmilies($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->enable_smilies !== $v) {
			$this->enable_smilies = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::ENABLE_SMILIES;
		}

	} 
	
	public function setEnableMagicUrl($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->enable_magic_url !== $v) {
			$this->enable_magic_url = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::ENABLE_MAGIC_URL;
		}

	} 
	
	public function setEnableSig($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->enable_sig !== $v) {
			$this->enable_sig = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::ENABLE_SIG;
		}

	} 
	
	public function setPostUsername($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->post_username !== $v) {
			$this->post_username = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_USERNAME;
		}

	} 
	
	public function setPostSubject($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->post_subject !== $v) {
			$this->post_subject = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_SUBJECT;
		}

	} 
	
	public function setPostText($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->post_text !== $v) {
			$this->post_text = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_TEXT;
		}

	} 
	
	public function setPostChecksum($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->post_checksum !== $v) {
			$this->post_checksum = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_CHECKSUM;
		}

	} 
	
	public function setPostAttachment($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_attachment !== $v) {
			$this->post_attachment = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_ATTACHMENT;
		}

	} 
	
	public function setBbcodeBitfield($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->bbcode_bitfield !== $v) {
			$this->bbcode_bitfield = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::BBCODE_BITFIELD;
		}

	} 
	
	public function setBbcodeUid($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->bbcode_uid !== $v) {
			$this->bbcode_uid = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::BBCODE_UID;
		}

	} 
	
	public function setPostPostcount($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_postcount !== $v) {
			$this->post_postcount = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_POSTCOUNT;
		}

	} 
	
	public function setPostEditTime($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_edit_time !== $v) {
			$this->post_edit_time = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_EDIT_TIME;
		}

	} 
	
	public function setPostEditReason($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->post_edit_reason !== $v) {
			$this->post_edit_reason = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_EDIT_REASON;
		}

	} 
	
	public function setPostEditUser($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_edit_user !== $v) {
			$this->post_edit_user = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_EDIT_USER;
		}

	} 
	
	public function setPostEditCount($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_edit_count !== $v) {
			$this->post_edit_count = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_EDIT_COUNT;
		}

	} 
	
	public function setPostEditLocked($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->post_edit_locked !== $v) {
			$this->post_edit_locked = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::POST_EDIT_LOCKED;
		}

	} 
	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			//$this->modifiedColumns[] = PhpBbPostPeer::ID;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->post_id = $rs->getInt($startcol + 0);

			$this->topic_id = $rs->getInt($startcol + 1);

			$this->forum_id = $rs->getInt($startcol + 2);

			$this->poster_id = $rs->getInt($startcol + 3);

			$this->icon_id = $rs->getInt($startcol + 4);

			$this->poster_ip = $rs->getString($startcol + 5);

			$this->post_time = $rs->getInt($startcol + 6);

			$this->post_approved = $rs->getInt($startcol + 7);

			$this->post_reported = $rs->getInt($startcol + 8);

			$this->enable_bbcode = $rs->getInt($startcol + 9);

			$this->enable_smilies = $rs->getInt($startcol + 10);

			$this->enable_magic_url = $rs->getInt($startcol + 11);

			$this->enable_sig = $rs->getInt($startcol + 12);

			$this->post_username = $rs->getString($startcol + 13);

			$this->post_subject = $rs->getString($startcol + 14);

			$this->post_text = $rs->getString($startcol + 15);

			$this->post_checksum = $rs->getString($startcol + 16);

			$this->post_attachment = $rs->getInt($startcol + 17);

			$this->bbcode_bitfield = $rs->getString($startcol + 18);

			$this->bbcode_uid = $rs->getString($startcol + 19);

			$this->post_postcount = $rs->getInt($startcol + 20);

			$this->post_edit_time = $rs->getInt($startcol + 21);

			$this->post_edit_reason = $rs->getString($startcol + 22);

			$this->post_edit_user = $rs->getInt($startcol + 23);

			$this->post_edit_count = $rs->getInt($startcol + 24);

			$this->post_edit_locked = $rs->getInt($startcol + 25);

			$this->id = $rs->getInt($startcol + 26);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 27; 
		} catch (Exception $e) {
			throw new PropelException("Error populating PhpBbPost object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(PhpBbPostPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			PhpBbPostPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(PhpBbPostPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = PhpBbPostPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += PhpBbPostPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


			if (($retval = PhpBbPostPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = PhpBbPostPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getPostId();
				break;
			case 1:
				return $this->getTopicId();
				break;
			case 2:
				return $this->getForumId();
				break;
			case 3:
				return $this->getPosterId();
				break;
			case 4:
				return $this->getIconId();
				break;
			case 5:
				return $this->getPosterIp();
				break;
			case 6:
				return $this->getPostTime();
				break;
			case 7:
				return $this->getPostApproved();
				break;
			case 8:
				return $this->getPostReported();
				break;
			case 9:
				return $this->getEnableBbcode();
				break;
			case 10:
				return $this->getEnableSmilies();
				break;
			case 11:
				return $this->getEnableMagicUrl();
				break;
			case 12:
				return $this->getEnableSig();
				break;
			case 13:
				return $this->getPostUsername();
				break;
			case 14:
				return $this->getPostSubject();
				break;
			case 15:
				return $this->getPostText();
				break;
			case 16:
				return $this->getPostChecksum();
				break;
			case 17:
				return $this->getPostAttachment();
				break;
			case 18:
				return $this->getBbcodeBitfield();
				break;
			case 19:
				return $this->getBbcodeUid();
				break;
			case 20:
				return $this->getPostPostcount();
				break;
			case 21:
				return $this->getPostEditTime();
				break;
			case 22:
				return $this->getPostEditReason();
				break;
			case 23:
				return $this->getPostEditUser();
				break;
			case 24:
				return $this->getPostEditCount();
				break;
			case 25:
				return $this->getPostEditLocked();
				break;
			case 26:
				return $this->getId();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = PhpBbPostPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getPostId(),
			$keys[1] => $this->getTopicId(),
			$keys[2] => $this->getForumId(),
			$keys[3] => $this->getPosterId(),
			$keys[4] => $this->getIconId(),
			$keys[5] => $this->getPosterIp(),
			$keys[6] => $this->getPostTime(),
			$keys[7] => $this->getPostApproved(),
			$keys[8] => $this->getPostReported(),
			$keys[9] => $this->getEnableBbcode(),
			$keys[10] => $this->getEnableSmilies(),
			$keys[11] => $this->getEnableMagicUrl(),
			$keys[12] => $this->getEnableSig(),
			$keys[13] => $this->getPostUsername(),
			$keys[14] => $this->getPostSubject(),
			$keys[15] => $this->getPostText(),
			$keys[16] => $this->getPostChecksum(),
			$keys[17] => $this->getPostAttachment(),
			$keys[18] => $this->getBbcodeBitfield(),
			$keys[19] => $this->getBbcodeUid(),
			$keys[20] => $this->getPostPostcount(),
			$keys[21] => $this->getPostEditTime(),
			$keys[22] => $this->getPostEditReason(),
			$keys[23] => $this->getPostEditUser(),
			$keys[24] => $this->getPostEditCount(),
			$keys[25] => $this->getPostEditLocked(),
			$keys[26] => $this->getId(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = PhpBbPostPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setPostId($value);
				break;
			case 1:
				$this->setTopicId($value);
				break;
			case 2:
				$this->setForumId($value);
				break;
			case 3:
				$this->setPosterId($value);
				break;
			case 4:
				$this->setIconId($value);
				break;
			case 5:
				$this->setPosterIp($value);
				break;
			case 6:
				$this->setPostTime($value);
				break;
			case 7:
				$this->setPostApproved($value);
				break;
			case 8:
				$this->setPostReported($value);
				break;
			case 9:
				$this->setEnableBbcode($value);
				break;
			case 10:
				$this->setEnableSmilies($value);
				break;
			case 11:
				$this->setEnableMagicUrl($value);
				break;
			case 12:
				$this->setEnableSig($value);
				break;
			case 13:
				$this->setPostUsername($value);
				break;
			case 14:
				$this->setPostSubject($value);
				break;
			case 15:
				$this->setPostText($value);
				break;
			case 16:
				$this->setPostChecksum($value);
				break;
			case 17:
				$this->setPostAttachment($value);
				break;
			case 18:
				$this->setBbcodeBitfield($value);
				break;
			case 19:
				$this->setBbcodeUid($value);
				break;
			case 20:
				$this->setPostPostcount($value);
				break;
			case 21:
				$this->setPostEditTime($value);
				break;
			case 22:
				$this->setPostEditReason($value);
				break;
			case 23:
				$this->setPostEditUser($value);
				break;
			case 24:
				$this->setPostEditCount($value);
				break;
			case 25:
				$this->setPostEditLocked($value);
				break;
			case 26:
				$this->setId($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = PhpBbPostPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setPostId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setTopicId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setForumId($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setPosterId($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setIconId($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setPosterIp($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setPostTime($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setPostApproved($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setPostReported($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setEnableBbcode($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setEnableSmilies($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setEnableMagicUrl($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setEnableSig($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setPostUsername($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setPostSubject($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setPostText($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setPostChecksum($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setPostAttachment($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setBbcodeBitfield($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setBbcodeUid($arr[$keys[19]]);
		if (array_key_exists($keys[20], $arr)) $this->setPostPostcount($arr[$keys[20]]);
		if (array_key_exists($keys[21], $arr)) $this->setPostEditTime($arr[$keys[21]]);
		if (array_key_exists($keys[22], $arr)) $this->setPostEditReason($arr[$keys[22]]);
		if (array_key_exists($keys[23], $arr)) $this->setPostEditUser($arr[$keys[23]]);
		if (array_key_exists($keys[24], $arr)) $this->setPostEditCount($arr[$keys[24]]);
		if (array_key_exists($keys[25], $arr)) $this->setPostEditLocked($arr[$keys[25]]);
		if (array_key_exists($keys[26], $arr)) $this->setId($arr[$keys[26]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(PhpBbPostPeer::DATABASE_NAME);

		if ($this->isColumnModified(PhpBbPostPeer::POST_ID)) $criteria->add(PhpBbPostPeer::POST_ID, $this->post_id);
		if ($this->isColumnModified(PhpBbPostPeer::TOPIC_ID)) $criteria->add(PhpBbPostPeer::TOPIC_ID, $this->topic_id);
		if ($this->isColumnModified(PhpBbPostPeer::FORUM_ID)) $criteria->add(PhpBbPostPeer::FORUM_ID, $this->forum_id);
		if ($this->isColumnModified(PhpBbPostPeer::POSTER_ID)) $criteria->add(PhpBbPostPeer::POSTER_ID, $this->poster_id);
		if ($this->isColumnModified(PhpBbPostPeer::ICON_ID)) $criteria->add(PhpBbPostPeer::ICON_ID, $this->icon_id);
		if ($this->isColumnModified(PhpBbPostPeer::POSTER_IP)) $criteria->add(PhpBbPostPeer::POSTER_IP, $this->poster_ip);
		if ($this->isColumnModified(PhpBbPostPeer::POST_TIME)) $criteria->add(PhpBbPostPeer::POST_TIME, $this->post_time);
		if ($this->isColumnModified(PhpBbPostPeer::POST_APPROVED)) $criteria->add(PhpBbPostPeer::POST_APPROVED, $this->post_approved);
		if ($this->isColumnModified(PhpBbPostPeer::POST_REPORTED)) $criteria->add(PhpBbPostPeer::POST_REPORTED, $this->post_reported);
		if ($this->isColumnModified(PhpBbPostPeer::ENABLE_BBCODE)) $criteria->add(PhpBbPostPeer::ENABLE_BBCODE, $this->enable_bbcode);
		if ($this->isColumnModified(PhpBbPostPeer::ENABLE_SMILIES)) $criteria->add(PhpBbPostPeer::ENABLE_SMILIES, $this->enable_smilies);
		if ($this->isColumnModified(PhpBbPostPeer::ENABLE_MAGIC_URL)) $criteria->add(PhpBbPostPeer::ENABLE_MAGIC_URL, $this->enable_magic_url);
		if ($this->isColumnModified(PhpBbPostPeer::ENABLE_SIG)) $criteria->add(PhpBbPostPeer::ENABLE_SIG, $this->enable_sig);
		if ($this->isColumnModified(PhpBbPostPeer::POST_USERNAME)) $criteria->add(PhpBbPostPeer::POST_USERNAME, $this->post_username);
		if ($this->isColumnModified(PhpBbPostPeer::POST_SUBJECT)) $criteria->add(PhpBbPostPeer::POST_SUBJECT, $this->post_subject);
		if ($this->isColumnModified(PhpBbPostPeer::POST_TEXT)) $criteria->add(PhpBbPostPeer::POST_TEXT, $this->post_text);
		if ($this->isColumnModified(PhpBbPostPeer::POST_CHECKSUM)) $criteria->add(PhpBbPostPeer::POST_CHECKSUM, $this->post_checksum);
		if ($this->isColumnModified(PhpBbPostPeer::POST_ATTACHMENT)) $criteria->add(PhpBbPostPeer::POST_ATTACHMENT, $this->post_attachment);
		if ($this->isColumnModified(PhpBbPostPeer::BBCODE_BITFIELD)) $criteria->add(PhpBbPostPeer::BBCODE_BITFIELD, $this->bbcode_bitfield);
		if ($this->isColumnModified(PhpBbPostPeer::BBCODE_UID)) $criteria->add(PhpBbPostPeer::BBCODE_UID, $this->bbcode_uid);
		if ($this->isColumnModified(PhpBbPostPeer::POST_POSTCOUNT)) $criteria->add(PhpBbPostPeer::POST_POSTCOUNT, $this->post_postcount);
		if ($this->isColumnModified(PhpBbPostPeer::POST_EDIT_TIME)) $criteria->add(PhpBbPostPeer::POST_EDIT_TIME, $this->post_edit_time);
		if ($this->isColumnModified(PhpBbPostPeer::POST_EDIT_REASON)) $criteria->add(PhpBbPostPeer::POST_EDIT_REASON, $this->post_edit_reason);
		if ($this->isColumnModified(PhpBbPostPeer::POST_EDIT_USER)) $criteria->add(PhpBbPostPeer::POST_EDIT_USER, $this->post_edit_user);
		if ($this->isColumnModified(PhpBbPostPeer::POST_EDIT_COUNT)) $criteria->add(PhpBbPostPeer::POST_EDIT_COUNT, $this->post_edit_count);
		if ($this->isColumnModified(PhpBbPostPeer::POST_EDIT_LOCKED)) $criteria->add(PhpBbPostPeer::POST_EDIT_LOCKED, $this->post_edit_locked);
		if ($this->isColumnModified(PhpBbPostPeer::ID)) $criteria->add(PhpBbPostPeer::ID, $this->id);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(PhpBbPostPeer::DATABASE_NAME);

		$criteria->add(PhpBbPostPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setPostId($this->post_id);

		$copyObj->setTopicId($this->topic_id);

		$copyObj->setForumId($this->forum_id);

		$copyObj->setPosterId($this->poster_id);

		$copyObj->setIconId($this->icon_id);

		$copyObj->setPosterIp($this->poster_ip);

		$copyObj->setPostTime($this->post_time);

		$copyObj->setPostApproved($this->post_approved);

		$copyObj->setPostReported($this->post_reported);

		$copyObj->setEnableBbcode($this->enable_bbcode);

		$copyObj->setEnableSmilies($this->enable_smilies);

		$copyObj->setEnableMagicUrl($this->enable_magic_url);

		$copyObj->setEnableSig($this->enable_sig);

		$copyObj->setPostUsername($this->post_username);

		$copyObj->setPostSubject($this->post_subject);

		$copyObj->setPostText($this->post_text);

		$copyObj->setPostChecksum($this->post_checksum);

		$copyObj->setPostAttachment($this->post_attachment);

		$copyObj->setBbcodeBitfield($this->bbcode_bitfield);

		$copyObj->setBbcodeUid($this->bbcode_uid);

		$copyObj->setPostPostcount($this->post_postcount);

		$copyObj->setPostEditTime($this->post_edit_time);

		$copyObj->setPostEditReason($this->post_edit_reason);

		$copyObj->setPostEditUser($this->post_edit_user);

		$copyObj->setPostEditCount($this->post_edit_count);

		$copyObj->setPostEditLocked($this->post_edit_locked);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new PhpBbPostPeer();
		}
		return self::$peer;
	}

} 